<?php echo $this->element('user'); ?>
<div class="aTitle">
	<h2>Courses</h2>
</div>
<div class="assessment">
	<div class="aToolbar">
		<span class="aToolbarButton">
			<span class="iconNew"></span>
			<a href="/users/add" title="Add New User">Add New User</a>
		</span>
	</div>
<fieldset>
<div class="aTable">
	<div class="aTableHeader">
		<span class="aTableDelete">Delete</span>
		<span class="aTableEdit">Edit</span>
		<span class="aTableUsername">Username</span>
		<span class="aTableName">Name</span>
	</div>
	<?php  ?>
<?php 
	$i = 0;//switch between 1 and 0 to toggle between the two list classes
foreach ($users as $user){ 
	$questiongroups = '';

	if($i == 0)
	{
		$questiongroups .=  '<div class="aTableRowA">';
		$i = 1;
	}
	else
	{
		$questiongroups .=  '<div class="aTableRowB">';
		$i = 0;
	}

	echo $questiongroups;
	print '
	<span class="aTableDelete">
		<a href="javascript:checkDelete(\'/users/delete/'.$user['User']['id'].'\');">
		<span class="iconDelete"></span></a>
	</span>
	<span class="aTableEdit">
		<a href="/users/edit/'.$user['User']['id'].'">
		<span class="iconEdit"></span></a>
	</span>
	<span class="aTableUsername">
		<a href="/users/edit/'.$user['User']['id'].'">'.$user['User']['username'].'</a>	</span>
	<span class="aTableName">
		'.$user['User']['firstname'].' '.$user['User']['lastname'].'
	</span>
	</div>
	';
}
?>
</fieldset>
</div>
